<script language='javascript' type='text/javascript' src="<?=base_url('block')?>scripts/block.js"></script>
<?php echo form_open($this->block_detail_model->url_prefix); ?>
<?if($msg){?><center><div class="messageBox"><?=$msg?></div></center><?}?>
<table border="0" cellspacing="0" cellpadding="0" class="infoTable">
  <tr>
    <td id='infoStr'>Block Type:</td>
    <td id='infoInput' align='left'><?=$block_type?><input name="block_type" id="block_type" type="hidden" value="<?=$block_type?>" /></td>
  </tr>
  <tr>
    <td id='infoStr'>Name *:</td>
    <td id='infoInput' align='left'><input name="name" id="name" type="text" value="<?=h($name)?>" size="50" /></td>
  </tr>
<?php if($block_type == 'JT') {?>
  <tr>
    <td id='infoStr'>Content:</td>
    <td id='infoInput' align='left'>{content}<input type="hidden" name="obj_id" value="0" /></td>
  </tr>
<? } else { ?>
  <tr>
    <td id='infoStr'>Image:</td>
    <td id='infoInput' align='left'>
		<?=Modules::run('image.image.dropdown')?>
<br />
<img id="out" src="<?=base_url()?>{image_review}" />
<script language="javascript">
function ajax_response(originalRequest) 
{
	$('out').src = originalRequest.responseText;
}

function display_image(sel)
{
	var id = sel.options[sel.options.selectedIndex].value;
	var url = SITE_URL + 'admin_ajax/image.image.display_image';
	var myAjax = new Ajax.Request(
		url,
		{method: 'post', parameters: "id="+id, onComplete: ajax_response}
	);
}
</script>
<input type="hidden" name="content" value="" />
	</td>
  </tr>
<? } ?>
  <tr>
    <td id='infoStr'>&nbsp;</td>
    <td id='infoInput' align='left'>
        <input type="button" value="Save" class="save_button" style="cursor:pointer" onclick="return block.saveItem({start}, {item_id})" />&nbsp;
        <input type="button" value="Cancel" class="cancel_button" style="cursor:pointer" onclick="block.cancel({start})" />
    </td>
  </tr>
</table>
</form>